/**
 * 随机生成字符串
 * @type {[type]}
 */
export const randomString = (len: number) => {
  len = len || 32;
  var $chars =
    'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
  var maxPos = $chars.length;
  var pwd = '';
  for (let i = 0; i < len; i++) {
    pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  }
  return pwd;
};

export const formatNumber = (num: number) => {
  if (num >= 100000) {
    // 六位转亿元
    return Math.floor(num / 10000) + '亿';
  }
  return Math.floor(num / 10) + '万'; // 非六位转万元
};
